<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: brand.php 4887 2010-11-12 04:39:39Z yexinhao $
 */

define('CURSCRIPT', 'brand');
define('CURMODULE', 'stat');
require_once('../common.php');

if(empty($_G['gp_hash']) || strlen($_G['gp_hash']) != 32 || empty($_G['gp_timestamp'])) {
	exit('Invalid Request');
}

if(abs($_G['gp_timestamp'] - TIMESTAMP) > 86400) {
	exit('Invalid Request');
}

$siteuniqueid = (string) $_G['setting']['siteuniqueid'];
if(empty($siteuniqueid) || $_G['gp_hash'] != md5(md5($siteuniqueid).$_G['gp_timestamp'])) {
	exit('Invalid Request');
}

if($_G['gp_action'] == 'updatelog') {
	$log_file = B_ROOT.'./data/log/update.log.php';
	@include($log_file);
	if(is_array($updatelog) && !empty($updatelog[$_G['gp_version']])) {
		echo $updatelog[$_G['gp_version']];
	} elseif($_G['gp_version'] == B_VER) {
		echo 'new';
	} else {
		echo 'NULL';
	}
} else {
	exit('Invalid Request');
}

?>